/*
 This file is part of BTStracker
		
    BTStracker is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    BTStracker is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.	
	author: azbest.pro (azbest.pro@gmail.com)
*/
package pl.vdl.azbest.mremote.map;

import java.io.File;
import java.net.URL;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;

public class HTMLgoogleMapCanvas extends Composite {

	private Browser browser = null;

	public HTMLgoogleMapCanvas(Composite parent, int style) {
		super(parent, style);
		initialize();
	}

	private void initialize() {
		createBrowser();
		setSize(new Point(300, 200));
		setLayout(new GridLayout());
	}

	/**
	 * This method initializes browser	
	 *
	 */
	private void createBrowser() {
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.verticalAlignment = GridData.FILL;
		browser = new Browser(this, SWT.NONE);
		File f = new File("map.html");
		f.getAbsoluteFile();
		
		//URL u = new URL("");
		
	
		browser.setUrl(f.getAbsolutePath());
		browser.setLayoutData(gridData);
	}

}
